package com.better.mongodb.test.repository;

import com.better.mongodb.test.UserEntity;
import org.springframework.data.mongodb.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author xiaqi
 * 自定义方法接口
 * @create 2017-09-14 12:21
 **/
@Repository
public interface UserRepositoryUser extends UserRepository<UserEntity,String>{
    //根据规则spring data动态生成方法实现
    UserEntity findByUserName(String name);
    //自定义方法实现
    @Query("{'userName':'天空'}")
    public List<UserEntity> findAllaa();
}
